from django.urls import path
from .views import (
    PhoneLoginView,
    SendCodeView,
    dingtalk_login,
    dingtalk_callback,
    IdCardOcrView,
    IdCardUploadView,
    IdCardVerificationSubmitView,
    SliderInitView,
    SliderCheckView,
    LivingInitView,
    LivingCheckView,
    WeChatNativePayCreateView,
    WeChatPayNotifyView,
    WeChatPayQueryView,
)

urlpatterns = [
    # 手机号验证码登录
    path('login/phone/', PhoneLoginView.as_view(), name='phone-login'),
    path('login/code/send/', SendCodeView.as_view(), name='send-code'),

    # 滑动验证
    path('slider/init/', SliderInitView.as_view(), name='slider-init'),
    path('slider/check/', SliderCheckView.as_view(), name='slider-check'),

    # 发送验证码（支持滑动验证令牌）
    path('send-code/', SendCodeView.as_view(), name='send-code-with-token'),

    # 活体检测
    path('living/init/', LivingInitView.as_view(), name='living-init'),
    path('living/check/', LivingCheckView.as_view(), name='living-check'),

    # 身份证上传 / OCR（别名，便于前端按 /api/idcard/* 调用）
    path('idcard/upload/',IdCardUploadView.as_view(),name='idcard-upload-alias'),
    path('idcard/ocr/',IdCardOcrView.as_view(),name='idcard-ocr-alias'),

    # 钉钉扫码登录
    path('login/dingtalk/qrcode/',dingtalk_login,name='dingtalk_qrcode'),
    path('login/dingtalk/callback/',dingtalk_callback,name='dingtalk_callback'),

    # 身份证实名认证（原有路径保留）
    path('auth/idcard/ocr/', IdCardOcrView.as_view(), name='idcard-ocr'),
    path('auth/idcard/upload/', IdCardUploadView.as_view(), name='idcard-upload'),
    path('auth/idcard/submit/',IdCardVerificationSubmitView.as_view(),name='idcard-submit'),
    path('create/', WeChatNativePayCreateView.as_view(), name='wechat-pay-create'),
    path('notify/', WeChatPayNotifyView.as_view(), name='wechat-pay-notify'),
    path('query/', WeChatPayQueryView.as_view(), name='wechat-pay-query'),
    # 微信支付别名路径，兼容前端 /api/wechat/pay/* 写法
    path('wechat/pay/create/', WeChatNativePayCreateView.as_view(), name='wechat-pay-create-alias'),
    path('wechat/pay/query/', WeChatPayQueryView.as_view(), name='wechat-pay-query-alias'),
]
